#include "Camera.h"

Camera::Camera()
{
	camera_rect.top = 0;
	camera_rect.left = 0;
	camera_rect.right = camera_rect.left + 512;//800;
	camera_rect.bottom = camera_rect.top + 512;//600;
}

Camera::~Camera()
{
}

void Camera::update(D3DXVECTOR2 position, int width_map)
{
	camera_rect.left = position.x - 256;//400;
	if (camera_rect.left < 0)
		camera_rect.left = 0;
	if (camera_rect.left + 512 >= width_map)
	{
		camera_rect.left = width_map - 512;
	}
}
